package com.yr.log.task.handle;

import com.yr.common.EventModel;
import com.yr.log.task.EventHandler;
import com.yr.common.EventType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.List;

/**
 * Created by gx on 2017/6/8.
 */
@Component
public class LogErrorHandle implements EventHandler {
    private static final Logger log = LoggerFactory.getLogger(LogErrorHandle.class);
    @Override
    public void doHandle(EventModel model) {

        log.error("入参信息{} ---出参信息{} ---",model.getInputmsg(),model.getOutputmsg(),model.getException());
    }

    @Override
    public List<EventType> getSupportEventTypes() {
        return Arrays.asList(EventType.ERROR);
    }

}
